home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / mus / midi / MusicXRexxMacs.lha / macros / INVERT.mxe < prev    next >
Text File  |  1997-02-13  |  1KB  |  79 lines

  1.  
  2. /*  inverts notes to defined limits */
  3.  
  4. /* © Dick Doyle */
  5. options results                            
  6.  
  7. MXSLIDER "Upper Limit:,0,127,72"
  8. MXSLIDER "Lower Limit:,0,127,60"
  9. MXRADIO "Selected Notes,All Notes"    
  10. MXSLIDER "Channel Select,1,16,1"
  11. MXREQUEST "INVERT,DO IT"  
  12. if result == 0 then exit                        
  13.  
  14. MXPOINTER "sleepy"                        
  15.  
  16. MXVALUE 1        
  17. Highval = result
  18.  
  19. MXVALUE 2
  20. Lowval = result
  21.  
  22. MXVALUE 4
  23. Chanum = result
  24.  
  25. MXVALUE 3                                
  26. if result == 0 then BEGINSCAN 'selected'
  27. else BEGINSCAN 'all'    
  28.  
  29. if result ~= 0 then do forever            
  30.  
  31.   NEXTEVENT                                
  32.   if result == 0 then break
  33.  
  34.  
  35.   if EVENT.CHANNEL == chanum - 1 then
  36.   if  EVENT.TYPE == 'NOTE' then 
  37.   
  38.   if  EVENT.num > highval then 
  39. do while EVENT.NUM > highval
  40.  
  41. EVENT.NUM = EVENT.NUM - 12
  42.    
  43. REPLEVENT
  44. end
  45. end
  46. ENDSCAN
  47.  
  48.  
  49. MXVALUE 3                                
  50.  
  51. if result == 0 then BEGINSCAN 'selected'
  52. else BEGINSCAN 'all'    
  53.  
  54. if result ~= 0 then do forever            
  55.  
  56.   NEXTEVENT                                
  57.   if result == 0 then break
  58.  
  59.   if EVENT.CHANNEL == chanum - 1 then
  60.   if  EVENT.TYPE == 'NOTE' then 
  61. if  EVENT.num < lowval then 
  62. do while EVENT.NUM < lowval
  63.  
  64. EVENT.NUM = EVENT.NUM + 12
  65.      
  66. REPLEVENT
  67.  
  68.  end    
  69. end
  70.  
  71.  
  72.  
  73. ENDSCAN                                    
  74.  
  75. MXPOINTER "normal"                        
  76.    
  77. exit
  78.  
  79.